package org.clockworkmages.games.anno1186.model.situation;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;

import org.clockworkmages.games.anno1186.model.Effecting;
import org.clockworkmages.games.anno1186.model.GameObject;
import org.clockworkmages.games.anno1186.model.effect.Effect;
import org.clockworkmages.games.anno1186.model.option.Option;

public abstract class Situation
		extends GameObject implements Effecting {

	public Situation() {
	};

	public Situation(String id) {
		super(id);
	};

	private boolean clearScreen = true;

	private List<Option> options = new ArrayList<Option>();

	private String text;

	private String title;

	private List<Effect> effects = new ArrayList<Effect>();

	protected List<Option> asList(Option... options) {
		return Arrays.asList(options);
	}

	/**
	 * This method gets overwritten in technical Situations.
	 */
	public void update() {

	}

	@XmlAttribute
	public boolean isClearScreen() {
		return clearScreen;
	}

	public void setClearScreen(boolean clearScreen) {
		this.clearScreen = clearScreen;
	}

	public List<Option> getOptions() {
		return options;
	}

	public String getText() {
		return text;
	}

	public void setText(String text) {
		this.text = text;
	}

	@XmlAttribute
	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	@XmlElement(name = "effect")
	public List<Effect> getEffects() {
		return effects;
	}

	public void setEffects(List<Effect> effects) {
		this.effects = effects;
	}

}
